<template>
    <view class="quick-entrance">
        <u-grid :border="false" col="5" @click="goPage">
            <u-grid-item
                    v-for="(baseListItem,baseListIndex) in baseList"
                    :key="baseListIndex">
                <u-icon :customStyle="{paddingTop:10+'rpx'}"
                        :name="baseListItem.name"
                        :size="45"
                ></u-icon>
                <text class="grid-text">{{baseListItem.title}}</text>
            </u-grid-item>
        </u-grid>
    </view>
</template>

<script>
    export default {
        name: "QuickEntrance",
        data() {
            return {
                baseList: [
                    {
                        name: '/static/jpgy.png',
                        title: '整租整套',
                        location: '/pages/user/index/whole'
                    },
                    {
                        name: '/static/hz.png',
                        title: '合租单间',
                        location: '/pages/user/index/join'
                    },
                    {
                        name: '/static/jpgy.png',
                        title: '精品公寓',
                        location: '/pages/user/index/apartment'
                    },
                    {
                        name: '/static/bwzf.png',
                        title: '帮我找房',
                        location: '/pages/user/index/help'
                    },
                    {
                        name: '/static/lxwm.png',
                        title: '联系我们',
                        location: '/pages/user/index/contact'
                    },
                ]
            }
        },
        methods: {
            goPage(index) {
                uni.navigateTo({url: this.baseList[index].location});
            }
        }
    }
</script>

<style scoped>
    .quick-entrance {
        display: flex;
        width: 100%;
        margin: 20px 0 0 0;
    }

    .grid-text {
        font-size: 24rpx;
        font-weight: 500;
        color: #303133;
        padding: 10rpx 0 20rpx 0;
        box-sizing: border-box;
    }
</style>